import Vue from "vue";
import i18n from "@/common/lang/index.js";

// ZhCn，EnUs 后台格式xxZhCn,xxEnUs
const lang = {
  "zh": "ZhCn",
  "en": "EnUs",
}
const plugin = {
  install(vm, options) {
    vm.prototype.$langKey = (prop) => {
      return prop + lang[i18n.locale]
    }

    vm.prototype.$lang = (obj, prop) => {
      return obj[prop + lang[i18n.locale]]
    }
	
  }
}

Vue.use(plugin)